//
//  SWGrid.h
//  White Detector Grid
//
//  Created by David Langford on 6/05/09.
//  Copyright 2009 Sentient Worlds. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#include <Accelerate/Accelerate.h>

@interface SWGrid : NSObject {
	int 							numberOfColumns;
	int 							numberOfRows;
	int 							widthInPixels;
	int								heightInPixels;
	double							widthNormalised;
	double							heightNormalised;
	double							xOffsetNormalised;
	double							yOffsetNormalised;
	int								xOffsetInPixels;
	int								yOffsetInPixels;
	NSArray*						cells;
	double							destinationWidthInUnits;
	double							destinationHeightInUnits;
	double							destinationXOffsetInUnits;
	double							destinationYOffsetInUnits;
}

@property (assign) int numberOfColumns;
@property (assign) int numberOfRows;
@property (assign) int widthInPixels;
@property (assign) int heightInPixels;
@property (assign) double widthNormalised;
@property (assign) double heightNormalised;
@property (assign) double xOffsetNormalised;
@property (assign) double yOffsetNormalised;
@property (assign) double destinationWidthInUnits;
@property (assign) double destinationHeightInUnits;
@property (assign) double destinationXOffsetInUnits;
@property (assign) double destinationYOffsetInUnits;
@property (assign) int xOffsetInPixels;
@property (assign) int yOffsetInPixels;
@property (retain, readwrite) NSArray* cells;

- (id) initWithNumberOfColumns:(double)columns 
				  numberOfRows:(double)rows
					imageToUse:(id<QCPlugInInputImageSource>)theImage
				   withContext:(id<QCPlugInContext>)theContext
				  widthPercent:(double)theWidthPercent
				 heightPercent:(double)theHeightPercent
				xOriginPercent:(double)theXOriginPercent
				yOriginPercent:(double)theYOriginPercent 
	   destinationWidthInUnits:(double)theDestinationWidthInUnits
	  destinationHeightInUnits:(double)theDestinationHeightInUnits
				xOffsetInUnits:(double)theDestinationXOffsetInUnits
				yOffsetInUnits:(double)theDestinationYOffsetInUnits;
- (NSArray*) generateCellsUsingImage:(id<QCPlugInInputImageSource>)imageToUse
						  andContext:(id<QCPlugInContext>)theContext;
- (NSArray*) asNSArray;

@end
